import { Controller, Get, Post, Body, Patch, Param, Delete, Query, Request } from '@nestjs/common';
import { RechargeService } from './recharge.service';
import { CreateRechargeDto } from './dto/create-recharge.dto';
import { UpdateRechargeDto } from './dto/update-recharge.dto';
import { ApiOperation, ApiTags, ApiQuery, ApiBearerAuth } from '@nestjs/swagger';

@ApiBearerAuth()
@ApiTags('充值记录')
@Controller('recharge')
export class RechargeController {
  constructor(private readonly rechargeService: RechargeService) {}

  @Get('list')
  @ApiOperation({ summary: '查询', description: '查询' })
  @ApiQuery({ name: 'pageNum', type: Number, required: false, description: '页码' })
  @ApiQuery({ name: 'pageSize', type: Number, required: false, description: '每页几条' })
  findAll(@Query() params: any) {
    return this.rechargeService.findAll(params);
  }

  // 新增
  @Post('add')
  @ApiOperation({ summary: '新增', description: '新增' })
  create(@Body() createRechargeDto: CreateRechargeDto) {
    return this.rechargeService.create(createRechargeDto);
  }
}
